<?php

namespace app\services\system;

use app\services\BaseService;
use app\dao\system\SystemAdminDao;

/**
 * Class SystemAdmin
 * @package app\services\system
 */
class SystemAdminService extends BaseService
{
    public function __construct(SystemAdminDao $dao)
    {
        $this->dao = $dao;
    }

    public function getStatusList()
    {
        return ['0' => '禁用', '1' => '启用',];
    }

    /**
     * Description:
     *
     * @param array $where
     *
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getAdminList(array $where)
    {
        [$page, $limit] = $this->getPageValue();
        $where['is_del'] = 0;
        $data            = $this->dao->getList($where, $page, $limit);
        $count           = $this->dao->count($where);
        return compact('data', 'count');
    }
}